<?php
function sum(int $num1, $num2)
{
    if ($num1 > $num2) {
        $result = ($num1 + $num2) * ($num1 - $num2 + 1) / 2;
        echo "结果是" . $result;
    } else {
        echo "请输入合法参数!";
    }

}

sum( 100, 1 );